package com.distributeredis.redis_springboot.springbootinterceptor.controller;

import com.distributeredis.redis_springboot.springbootinterceptor.vo.UserPeople;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestInterceptorController {

    @PostMapping("/test1")
    public String test1(@RequestBody UserPeople userPeople) {
        return userPeople.toString();
    }

    @PostMapping("/test2")
    public String test2(@RequestBody UserPeople userPeople) {
        userPeople.setUserName("aaa");
        userPeople.setSex("bbb");
        return userPeople.toString();
    }
}
